/*******************************************************************
 * 外语翻译平台(translate) 
 *
 * 成都一亿信息技术公司 版权所有
 * 
 * Copyright (C) 2010 Transer Information Technology Co., Ltd.
 *
 * @Version : 1.0  2010-12-25 下午11:39:49
 *
 * NomarlAlphaValidator.java 
 *
 *******************************************************************/
package com.transer.web.validator;

import com.opensymphony.xwork2.validator.ValidationException;
import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
import com.transer.utils.Utils;

/**
 * class defination are there
 * 
 * @author Administrator
 * 
 * @version 1.0 ywengineer@gmail.com
 * 
 */
public class NomarlAlphaValidator extends FieldValidatorSupport {
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.opensymphony.xwork2.validator.Validator#validate(java.lang.Object)
	 */
	public void validate(Object object) throws ValidationException {
		String fieldName = getFieldName();
		Object value = getFieldValue(fieldName, object);

		if (value instanceof String) {
			if (Utils.isFull(value)) {
				addFieldError(fieldName, object);
			}
		}
	}
}
